#pragma once
#include <QtGui>
#include "..\core\TreeNode.h"

namespace Xps
{
	class Item : public QGraphicsItem
	{
	private:
		XpsAssets::TreeNode::NodeType type;
		int nodemarker;

	protected:
		QPen selectionpen;
		void paintSelectionRect(QPainter *painter);
		void paintHoverRect(QPainter *painter);

	public:
		QSizeF size;
		QColor color;
		QPen pen;
		QFont font;
		int textFlags;
		
		Item(XpsAssets::TreeNode::NodeType type);
		QString typeString();
		XpsAssets::TreeNode::NodeType getType() { return type; };
		virtual QRectF boundingRect() const;
		virtual QWidget* getWidget();
		virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
		void mousePressEvent(QGraphicsSceneMouseEvent *event);
		void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
		void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);

		void markTrue();
		void markFalse();
		void markNone();
		void drawTrueMarker(QPainter *painter);
		void drawFalseMarker(QPainter *painter);
	};

}